<?php
error_reporting(0);
$isadmin = 1;
include '../comm/config.php';
include '../comm/checkpostandget.php';
include 'check.php';

//淘宝总收益
$sql = "select sum(commission) as taobao_zsy from " . $BIAOTOU . "tradelist";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$taobao_zsy = $row["taobao_zsy"];
}
//联盟总收益
$sql = "select sum(commission) as mall_zsy from " . $BIAOTOU . "mall_order where stat_desc='核对有效'";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$mall_zsy = $row["mall_zsy"];
}
//网站总收益
$web_zsy = $taobao_zsy + $mall_zsy;
//网站总支出
$sql = "select sum(je) as web_zzc from " . $BIAOTOU . "mingxi where shijian='交易返现' or shijian='推广佣金' or shijian='注册赠送'";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$web_zzc = $row["web_zzc"];
}
//注册用户数
$sql = "select count(id) as usernum from " . $BIAOTOU . "user";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$usernum = $row["usernum"];
}
//淘宝交易记录数
$sql = "select count(id) as taobao_tradenum from " . $BIAOTOU . "tradelist";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$taobao_tradenum = $row["taobao_tradenum"];
}
//商城交易记录数
$sql = "select count(id) as mall_tradenum from " . $BIAOTOU . "mall_order";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$mall_tradenum = $row["mall_tradenum"];
}
//商城交易有效记录数
$sql = "select count(id) as mall_order_ok from " . $BIAOTOU . "mall_order where stat_desc='核对有效'";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$mall_order_ok = $row["mall_order_ok"];
}
//商城交易未核对记录数
$sql = "select count(id) as mall_order_no from " . $BIAOTOU . "mall_order where stat_desc='未核对'";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$mall_order_no = $row["mall_order_no"];
}
//商城交易未认领记录数
$sql = "select count(id) as mall_order_u_id from " . $BIAOTOU . "mall_order where u_id='0'";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$mall_order_u_id = $row["mall_order_u_id"];
}
//已经完成确认的淘宝交易
$sql = "select count(id) as tradenum_ok from " . $BIAOTOU . "tradelist where outer_code<>''";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$tradenum_ok = $row["tradenum_ok"];
}
//提现次数
$sql = "select count(id) as tixiannum from " . $BIAOTOU . "tixian";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$tixiannum = $row["tixiannum"];
}
//成功提现总金额
$sql = "select sum(je) as tixianje from " . $BIAOTOU . "mingxi where shijian='提现成功'";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$tixianje = $row["tixianje"];
}
//新提现请求
$sql = "select count(id) as newtixian from " . $BIAOTOU . "tixian where txstate=0";
mysql_select_db($dbname);
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$newtixian = $row["newtixian"];
}
//新订单审核请求
$sql = "select count(Id) as newshenhe from " . $BIAOTOU . "tradelist where checked=1";
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$newshenhe = $row["newshenhe"];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
.zuixin a { font-size:12px; color:#00FF00}
.zuixin a:visited{ font-size:12px; color:#999999;}
.zuixin a:active{ font-size:12px; color:#999999;}
.zuixin a:hove{color:#FF0000}
.left_txt a:hove{ font-size:16px; color:#FF0000;}
.banben {color: #FF0000; font-size:14px; font-weight:bold}
.STYLE2 {font-size: 12px; line-height: 25px; font-family: Arial, Helvetica, sans-serif;}
-->
</style>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/facebox.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
    $('a[rel*=facebox]').facebox();
	<?php
    if(APIJK=="1"){
    ?>
	$.get('../ajax.php',{'cache_dir':'data/Apicache','fun':'cacheSize'},function(data){
	    $('#cacheSize').html(data+' M');
		if(parseInt(data)>parseInt(<?=APISIZE?>)){
		     $('#doclear').html('缓存已经超过设置值请马上清除缓存');
		}
	});
    <?php }?>
});
</script>
</head>
<body>
<?php
if(file_exists('../data/update.lock'))
{
	echo "<table width=\"700\" border=\"0\" align=\"center\" style=\"border:#999999 1px solid;color:#FF0000; font-size:12px; padding-left:10px;\">
<tr>
<td width=\"75\" height=\"14\"><img src=\"images/ipsecurity.gif\" /></td>
<td width=\"613\" height=\"26\">您好，你的网站还没有升级完整，请点击 &quot;继续升级&quot; 以完成最后一步。<a href=\"../update.php\" style=\"text-decoration:none; font-weight:bold; \"> 继续升级</a><br>如果点击后还无法进入后台，请登录FTP删除data内的update.lock文件即可！</td>
</tr>
</table>";
    exit();
}
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">欢迎界面</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9">
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="2" valign="top"><p><span class="left_bt"><br>感谢您使用 多多淘宝客 推广系统</span><br>
              <br>
              <span class="left_txt">&nbsp;<img src="images/ts.gif" width="16" height="16"> 当前版本：<span class="banben">V7.1</span>_UTF-8 - 更新日期：</span>
              <?php include("../comm/banben.php");?>
              &nbsp;&nbsp;&nbsp;<a href="http://bbs.duoduo123.com/read.php?tid=1965" target="_blank">是否最新？</a>&nbsp;&nbsp;&nbsp;<a href="http://pay.duoduo123.com/aut/aut.php?nick=<?php echo urlencode(MYUSERNICK);?>" target="_blank">我的授权</a></p>
          <p><span class="left_txt">&nbsp;使用便捷栏：<a href="http://bbs.duoduo123.com/thread.php?fid=41" target="_blank">帮助中心①&nbsp;</a><a href="http://soft.duoduo123.com/help/" target="_blank">&nbsp;&nbsp;帮助中心②</a>            &nbsp;<a href="http://bbs.duoduo123.com/thread.php?fid=39" target="_blank">提交问题</a> &nbsp;<a href="http://bbs.duoduo123.com/thread-htm-fid-37.html" target="_blank">发展与建议</a></span></p>
      <p><span class="left_txt">&nbsp;站务便捷：<a href="webset.php" style="color:#FF0000">网站设置</a>&nbsp;&nbsp;&nbsp;<a href="tradelist.php">交易记录</a> &nbsp;&nbsp;<a href="temp.php">清理缓存</a> &nbsp;&nbsp;<a href="http://soft.duoduo123.com/help/V70/2011/0219/141.html" target="_blank">安全设置</a> &nbsp;&nbsp;</span>
          <span ><a href="#mydiv" rel="facebox" >设置向导</a></span> &nbsp;&nbsp;<span class="left_txt"><a href="http://soft.duoduo123.com/help/V70/" target="_blank" style="color:#FF6600"> V7专题</a><img src="images/hot2.gif" width="28" height="11"><br></span></p>
          <span class="left_txt">提示：请及时更改后台路径目录。</span>
          </td>
        <td width="7%">&nbsp;</td>
        <td width="44%" valign="top">
        <table width="100%" height="144" border="0" cellpadding="0" cellspacing="0" class="line_table">
          <tr><td height="27" background="images/news-title-bg.gif" class="left_bt2" style=" padding-left:10px;">最新动态</td></tr>
          <tr>
            <td height="102" valign="top"><?php $opts = array('http'=>array('method'=>"GET",'timeout'=>2,));
$context = stream_context_create($opts);
$open =file_get_contents(base64_decode("aHR0cDovL3BheS5kdW9kdW8xMjMuY29tL2Nrb3Blbi5waHA="), false, $context);
fpassthru($fp);
if($open=='1'){?><iframe frameborder='0' marginheight='0' marginwidth='0' border='0' id='alimamaifrm' name='alimamaifrm' scrolling='no' height='120' width='360' src='http://soft.duoduo123.com/data/updata.html' ></iframe><?php }else{echo "获取信息失败，请稍候再试。";}?></td>
            </tr>
          <tr>
            <td height="5">&nbsp;</td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td colspan="2" valign="top"><!--JavaScript部分-->
              <SCRIPT language=javascript>
function secBoard(n){
	$('#qiehuan TD').attr('class','sec1');
    $('#sec'+n).attr('class','sec2');
	
	$('#tbody2').hide();
	$('#tbody1').hide();
	$('#tbody'+n).show();
}
          </SCRIPT>
              <!--HTML部分-->
              <TABLE width=72% border=0 cellPadding=0 cellSpacing=0 id=secTable>
                <TBODY>
                  <TR align=middle height=20 id="qiehuan">
                    <TD align="center" class="sec2" id="sec2" onclick=secBoard(2) style="cursor:pointer">监控中心</TD>
                    <TD align="center" class="sec1" id="sec1" onclick=secBoard(1) style="cursor:pointer">程序特色</TD>
                  </TR>
                </TBODY>
              </TABLE>
          <TABLE class=main_tab id=mainTable cellSpacing=0 cellPadding=0 width="100%" border=0>
          
          <TBODY  id="tbody2">
                  <TR>
                    <TD vAlign=top align=middle>
                    <TABLE width="100%" height="135" border=0 align="left" cellPadding=0 cellSpacing=0 >
                        <TBODY style=" text-align:left;">
                          <TR>
                            <TD width="4%" height="28" background="images/news-title-bg.gif"></TD>
                            <TD width="96%" height="25" colspan="2" background="images/news-title-bg.gif" class="left_txt">亲爱的管理员： <span class="left_ts">
                           <?php 
								  if($newtixian!=0)
								  {
									echo ("<font color=#009900><b>有 ".$newtixian." 条提现申请未处理！ >><a href=tixianlist.php class=link4>马上处理</a></b></font>&nbsp;&nbsp;");
								  }
								  ?><?php 
								  if($newshenhe!=0)
								  {
									echo ("<font color=#009900><b>有 ".$newshenhe." 条订单审核未处理！ >><a href=checktradelist.php class=link4>马上处理</a></b></font>&nbsp;&nbsp;");
								  }
					  		?>
                            </span></TD>
                          </TR>
                          <?php if(APIJK=="1"){?>
                          <TR>
                            <TD width="4%" height="28" bgcolor="#FAFBFC"></TD>
                            <TD height="25" colspan="2" bgcolor="#FAFBFC" class="left_txt">
                            
<span class="left_txt">缓存文件大小：<span id="cacheSize">正在读取缓存大小...</span></span> <b style="margin-left:15px"><a id="doclear" style="color:#F00; text-decoration:none" href="doclear.php"></a></b>&nbsp;&nbsp;&nbsp;<a href="temp.php">设置</a></TD>
                          </TR><?php }?>
                          <TR>
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                            <TD width="42%" height="25" bgcolor="#FAFBFC"><span class="left_txt">程序授权给：<b class="left_txt2"><a href="http://pay.duoduo123.com/aut/aut.php?nick=<?php echo urlencode(MYUSERNICK);?>" target="_blank"><?php echo MYUSERNICK;?></a></b></span></TD>
                            <TD width="54%" height="25" bgcolor="#FAFBFC">&nbsp;</TD>
                        </TR>
                          <TR>
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                            <TD width="42%" height="25" bgcolor="#FAFBFC"><span class="left_txt">本站总收益： </span> <span class="left_ts"> <?php echo round($web_zsy,2);?> 元</span></TD>
                            <TD width="54%" height="25" bgcolor="#FAFBFC"><span class="left_txt">本站净收益： </span> <span class="left_ts"> <?php echo round(($web_zsy-$web_zzc),2);?> 元 </span></TD>
                          </TR>
                          <TR>
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">提现总数： </span> <span class="left_ts"><?php echo $tixiannum;?> 次 </span></TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">提现总金额： </span> <span class="left_ts"><b><?php echo round(-$tixianje,2);?> 元</b></span></TD>
                         </TR>
                          <TR>
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">注册用户数： </span>
                                <span class="left_ts"><?php echo $usernum;?> 个</span></TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">本站总支出： </span> <span class="left_ts"><?php echo round($web_zzc,2); ?> 元 </span></TD>
                        </TR>
                        <tr><td style="height:1px; overflow:hidden" colspan="3"></td></tr>
						  <TR >
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt" style="font-weight:bold">淘宝联盟</span></TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt" style="font-weight:bold">其他联盟</span></TD>
                          </TR>
                          <TR>
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">收益： </span> <span class="left_ts"> <?php echo round($taobao_zsy,2);?> 元</span></TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">收益： </span> <span class="left_ts"> <?php echo round($mall_zsy,2);?> 元</span></TD>
                          </TR>
                          <TR>
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt"><span class="left_txt">交易总数： </span>
                               
                                <span class="left_ts"><?php echo $taobao_tradenum;?> 条</span></span></TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">交易总数： <span class="left_ts"><?php echo $mall_tradenum;?> 条</span></span></TD>
                          </TR>
                          <TR>
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">已完成确认的交易： </span> <span class="left_ts"> <?php echo $tradenum_ok;?> 个</span></TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">核对有效的交易： </span> <span class="left_ts"> <?php echo $mall_order_ok;?> 个</span></TD>
                          </TR>
                          <TR>
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">还未被确认的交易： </span> <span class="left_ts"><?php echo $taobao_tradenum-$tradenum_ok;?> 个</span></TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">未核对的交易： </span> <span class="left_ts"><?php echo $mall_order_no;?> 个</span></TD>
                          </TR>
                          <TR>
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                            <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">待添加....</span></TD>
                          <TD height="25" bgcolor="#FAFBFC"><span class="left_txt">未认领的交易： </span> <span class="left_ts"><?php echo $mall_order_u_id;?> 个</span></TD>
                          </TR>
                        </TBODY>
                    </TABLE></TD>
                  </TR>
                </TBODY>
          
                <!--关于TBODY标记-->
                
                <!--关于cells集合-->
                <TBODY style="DISPLAY: none"  id="tbody1">
                  <TR>
                    <TD vAlign=top align=middle>
                    <TABLE width="100%" height="138" border=0 align="left" cellPadding=0 cellSpacing=0 >
                        <TBODY>
                          <TR>
                            <TD width="4%" height="28" background="images/news-title-bg.gif"></TD>
                            <TD colspan="2" background="images/news-title-bg.gif" class="left_txt">特色简述</TD>
                          </TR>
                          <TR>
                            <TD bgcolor="#FAFBFC">&nbsp;</TD>
                          
                            <TD width="100%" bgcolor="#FAFBFC" style="text-align:left">
                            <p class="left_txt">
                            1、	B2C商城返现：可实现凡客、当当网、乐淘网等自动返现。<br>
                            2、	会员等级：不同会员等级可设置不同返现比例<br>
                                3、	全自动跟单：客户无需提交订单，程序自动完成。<br>
                                4、	模板与程序分离：后台随意切换。以不变应万变。 <br>
                              5、	返现宝：直接右键查询返现。对客户来说非常方便。<br>
                              6、	伪静态：更有利于各大引擎收录。<br>
                              7、	UC整合：可以和其他各大网站系统如CMS 网店系统等实现会员共享。<br>
                              8、	文章发布系统：可以发布购物资讯，公告等等，增加网站的权重。<br>
                              9、	更多请体验多多淘宝客。<br>
                             </p></TD>
                          </TR>
                        </TBODY>
                    </TABLE></TD>
                  </TR>
                </TBODY>
             </TABLE>
             
             </td>
        <td>&nbsp;</td>
        <td valign="top"><table width="100%" height="144" border="0" cellpadding="0" cellspacing="0" class="line_table">
          <tr>
            <td width="0%" height="27" background="images/news-title-bg.gif"></td>
            <td background="images/news-title-bg.gif" class="left_bt2"  style=" padding-left:10px;">  官方公告</td>
            </tr>
          <tr>
            <td height="102" valign="top"></td>
            <td height="102" valign="top"><?php
if($open=='1'){?><iframe frameborder="0" marginheight="0" marginwidth="0" border="0" id="alimamaifrm" name="alimamaifrm" scrolling="No" height="125" width="360" src="http://soft.duoduo123.com/data/gonggao.html" ></iframe><?php }else{echo "获取信息失败，请稍候再试。";}?>
</td>
          </tr>
          <tr>
            <td height="5" colspan="2">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="40" colspan="4"><table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
          <tr>
            <td></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td width="2%">&nbsp;</td>
        <td width="51%" class="left_txt"> 官方网站：<a href="http://soft.duoduo123.com" target="_blank">http://soft.duoduo123.com</a><br>
              官方论坛：<a href="http://bbs.duoduo123.com" target="_blank">http://bbs.duoduo123.com</a>		    </td>
        <td>&nbsp;</td>
        <td><span class="left_txt">自助购买：<a href="http://pay.duoduo123.com" target="_blank">http://pay.duoduo123.com</a><br>
淘宝购买：<a href="http://ddtk.taobao.com" target="_blank">http://ddtk.taobao.com</a></span></td>
      </tr>
    </table></td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
<link href="http://soft.duoduo123.com/remote/facefiles/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<div id="mydiv" style="display:none; font:12px; color:#666666;">
<br />
首先更改后台路径admin、删除install目录及文件。<br /><br />
第一步：网站基本设置：将网站名称等设置完成。 <a href="webset.php">设置</a><br /><br />
第二步：淘宝客设置：将淘宝API调用相关设置完成。 <a href="taobaokeset.php">设置</a><br /><br />
第三步：联盟设置：实现B2C商城返利必要步骤。 <a href="mall/mall_set.php">设置</a><br /><br />
第四步：公告、帮助信息、及资讯添加。 <a href="article/article.add.php?act=add">添加</a><br /><br />
第五步：首页幻灯片设置：将首页幻灯片设置为自己想要的图片和链接。 <a href="slides_list.php">设置</a><br /><br />
第六步：站点广告设置：位置和大小可参考模板，如果不需要可全部清空。 <a href="adlist.php">设置</a><br /><br />
第七步：友情链接：增加友情链接。 <a href="yqljlist.php">设置</a><br /><br />
第八步：合作链接：增加合作链接。 <a href="hzhblist.php">设置</a><br /><br />
第九步：logo替换。查看LOGO图片更是及路径，默认模板为logo.gif，模板目录即template/default/images/logo.gif；<br /><br />
 OK，您的网站基本设置完成。其他可按自己需要添加或修改。<br /><br />
如果自己不熟悉，可安装我们默认数据包，然后根据需要删减。<br /><br />
</div>
</body>
